{% extends 'news/base.html' %}
{% block titleBlock %}
    文章详情页
{% endblock %}
{% block scriptBlock %}
    <script src="../../static/news/js/detail.js"></script>
{% endblock %}
{% block contentBlock %}
    <div class="detail_con fl">
        <input type="hidden" id="news_id" value="{{ data.news.id }}">
        <input type="hidden" id="author_id" value="{{ data.news.user.id }}">
        <input type="hidden" id="is_collected" value="{{ data.is_collected }}">
        <input type="hidden" id="is_followed" value="{{ data.is_followed }}">
        {% if data.user %}
            <input type="hidden" id="user_id" value="{{ data.user.id }}">
        {% endif %}
        <h3>{{ data.news.title }}</h3>
        <div class="detail_about clearfix">
            <span class="time_souce fl">{{ data.news.create_time }} 来源: {{ data.news.source }}</span>
            <span class="comment fr">{{ data.news.clicks }}</span>
        </div>
        <p class="summary">
            {{ data.news.digest }}
        </p>
        {{ data.news.content | safe }}
        {#        <p class="summary">#}
        {#            摘要：昨天终结十一连阳之后，今天A股迅速重拾涨势，沪指收涨0.8%创逾两个月新高。房地产板块集体走强，尾盘更是放量大涨，万科A一度逼近涨停，最终收涨8.4%，股价创历史新高。#}
        {#        </p>#}
        {##}
        {#        <h4>恒指创收盘历史新高</h4>#}
        {##}
        {#        <p>#}
        {#            港股方面今天表现强劲，开年以来的上涨势头仍然延续，恒指收涨1.8%创下收盘新高。此前恒指的峰值是在2007年10月份盘中触及的31958点。</p>#}
        {#        <p>#}
        {#            今天恒指51支成份股中，42支上涨，7支下跌，对恒指贡献最大的个股包括建设银行上涨3.7%，腾讯控股上涨2.5%，香港交易所上涨5.9%，工商银行上涨3.3%，中国平安上涨2.8%。</p>#}
        {#        <p>#}
        {#            2018年的前15日，恒生指数已经上涨了4.75%，恒生国企指数上涨了6.50%。</p>#}
        {#        <p>#}
        {#            兴业证券张忆东在最新报告中表示，港股作为全球估值洼地，不论是分红率高的价值股还是业绩确定的成长股都受益于新一年中资和海外机构资金的重新布局。他维持2016年以来对“港股牛市”的判断，认为2018年港股市场会出现核心资产驱动的慢牛、长牛行情。他还预计今年下半年港股将迎来牛市主升浪。</p>#}
        {#        <p>#}
        {#            与A股交相呼应，港股内房股今天也是集体爆发的行情。万科企业涨9.2%，融创中国涨3.7%，碧桂园涨3%，中国恒大涨1.6%。</p>#}
        {#        <p>#}
        {#            此外，中国平安港股股价再创历史新高，盘中一度触及91.00港元。中国平安在A股市场今天也一度上涨近2%，离历史高点仅一步之遥，但收盘时回落，最终收涨0.2%。</p>#}
        {#        <p>#}
        {#            昨天晚间，中国平安公布2017年保费收入，全年该集团控股子公司平安财险、平安人寿、平安养老、平安健康原保险合同保费收入分别为2159.84亿元、3689.34亿元、175.6亿元及21.47亿元，合计约6046.26亿元人民币，同比增28.9%。除此以外，市场传出中国平安旗下的陆金所将于4月分拆于香港上市，估值达600亿美元。</p>#}
        {##}
        <a href="javascript:;" class="collection block-center">收藏</a>
        <a href="javascript:;" class="collected block-center" style="display: none;"><span class="out">已收藏</span><span class="over">取消收藏</span></a>

        {% if not data.user %}
            <div class="comment_form_logout">
                登录发表你的评论
            </div>
        {% else %}
            <form action="" class="comment_form">
                <div class="person_pic">
                    <img src="{% if data.user.avatar_url %}
                    {{ data.user.avatar_url }}
                {% else %}
                    ../../static/news/images/person01.png
                {% endif %}" alt="用户图标">
                </div>
                <textarea placeholder="请发表您的评论" class="comment_input"></textarea>
                <input type="button" value="评 论" class="comment_sub" onclick="submit_comment()">
            </form>
        {% endif %}
        <div class="comment_count">
            {{ data.news.comments_count }}条评论
        </div>

        <div class="comment_list_con">
            {% for comment in data.comment_list %}
                <div class="comment_list">
                    <div class="person_pic fl">
                        <img src="{% if comment.user.avatar_url %}
                {{ comment.user.avatar_url }}
            {% else %}
                ../../static/news/images/person01.png
            {% endif %}" alt="用户图标">
                    </div>
                    <div class="user_name fl">{{ comment.user.nick_name }}</div>
                    <div class="comment_text fl">{{ comment.content }}</div>
                    {% if comment.parent %}
                        <div class="reply_text_con fl">
                            <div class="user_name2">{{ comment.parent.user.nick_name }}</div>
                            <div class="reply_text">
                                {{ comment.parent.content }}
                            </div>
                        </div>
                    {% endif %}
                    <div class="comment_time fl">{{ comment.create_time }}</div>
                    <a href="javascript:;" class="comment_up
                        {% if comment.is_like %}
                            has_comment_up
                        {% endif %} fr"
                       data-commentid="{{ comment.id }}"
                       data-likecount="{{ comment.like_count }}">
                        {% if comment.like_count > 0 %}
                            {{ comment.like_count }}
                        {% else %}
                            赞
                        {% endif %}</a>
                    <a href="javascript:;" class="comment_reply fr">回复</a>
                    <form class="reply_form fl" data-commentid="{{ comment.id }}">
                        <textarea class="reply_input"></textarea>
                        <input type="button" value="回复" class="reply_sub fr">
                        <input type="reset" name="" value="取消" class="reply_cancel fr">
                    </form>
                </div>
            {% endfor %}

            {#            <div class="comment_list">#}
            {#                <div class="person_pic fl">#}
            {#                    <img src="../../static/news/images/worm.jpg" alt="用户图标">#}
            {#                </div>#}
            {#                <div class="user_name fl">用户张山</div>#}
            {#                <div class="comment_text fl">#}
            {#                    遏制茅台酒价格过快上涨，多渠道供给，就不一定要买，租茅台酒也可以的，租售同权。开发共有产权茅台酒，让老百姓喝得起茅台酒，饮者有其酒。#}
            {#                </div>#}
            {#                <div class="reply_text_con fl">#}
            {#                    <div class="user_name2">用户李思</div>#}
            {#                    <div class="reply_text">#}
            {#                        遏制茅台酒价格过快上涨，多渠道供给，就不一定要买，租茅台酒也可以的，租售同权。开发共有产权茅台酒，让老百姓喝得起茅台酒，饮者有其酒。#}
            {#                    </div>#}
            {#                </div>#}
            {#                <div class="comment_time fl">2017-01-01 00:00:00</div>#}
            {#                <a href="javascript:;" class="comment_up has_comment_up fr" data-comment-id="1">1</a>#}
            {#                <a href="javascript:;" class="comment_reply fr">回复</a>#}
            {#                <from class="reply_form fl">#}
            {#                    <textarea class="reply_input"></textarea>#}
            {#                    <input type="submit" name="" value="回复" data-news-id="1" data-comment-id="1" class="reply_sub fr">#}
            {#                    <input type="reset" name="" value="取消" class="reply_cancel fr">#}
            {#                </from>#}
            {#            </div>#}
            {##}
            {#            <div class="comment_list">#}
            {#                <div class="person_pic fl">#}
            {#                    <img src="../../static/news/images/worm.jpg" alt="用户图标">#}
            {#                </div>#}
            {#                <div class="user_name fl">用户张山</div>#}
            {#                <div class="comment_text fl">#}
            {#                    遏制茅台酒价格过快上涨，多渠道供给，就不一定要买，租茅台酒也可以的，租售同权。开发共有产权茅台酒，让老百姓喝得起茅台酒，饮者有其酒。#}
            {#                </div>#}
            {#                <div class="comment_time fl">2017-01-01 00:00:00</div>#}
            {#                <a href="javascript:;" class="comment_up fr" data-comment-id="2">赞</a>#}
            {#                <a href="javascript:;" class="comment_reply fr">回复</a>#}
            {#                <from class="reply_form fl">#}
            {#                    <textarea class="reply_input"></textarea>#}
            {#                    <input type="submit" name="" value="回复" data-news-id="1" data-comment-id="2" class="reply_sub fr">#}
            {#                    <input type="reset" name="" value="取消" class="reply_cancel fr">#}
            {#                </from>#}
            {#            </div>#}
            {##}
            {#            <div class="comment_list">#}
            {#                <div class="person_pic fl">#}
            {#                    <img src="../../static/news/images/worm.jpg" alt="用户图标">#}
            {#                </div>#}
            {#                <div class="user_name fl">用户张山</div>#}
            {#                <div class="comment_text fl">#}
            {#                    遏制茅台酒价格过快上涨，多渠道供给，就不一定要买，租茅台酒也可以的，租售同权。开发共有产权茅台酒，让老百姓喝得起茅台酒，饮者有其酒。#}
            {#                </div>#}
            {#                <div class="comment_time fl">2017-01-01 00:00:00</div>#}
            {#                <a href="javascript:;" class="comment_up fr" data-comment-id="3">赞</a>#}
            {#                <a href="javascript:;" class="comment_reply fr">回复</a>#}
            {#                <from class="reply_form fl">#}
            {#                    <textarea class="reply_input"></textarea>#}
            {#                    <input type="submit" name="" value="回复" data-news-id="1" data-comment-id="3" class="reply_sub fr">#}
            {#                    <input type="reset" name="" value="取消" class="reply_cancel fr">#}
            {#                </from>#}
            {#            </div>#}
            {##}
            {#            <div class="comment_list">#}
            {#                <div class="person_pic fl">#}
            {#                    <img src="../../static/news/images/worm.jpg" alt="用户图标">#}
            {#                </div>#}
            {#                <div class="user_name fl">用户张山</div>#}
            {#                <div class="comment_text fl">#}
            {#                    遏制茅台酒价格过快上涨，多渠道供给，就不一定要买，租茅台酒也可以的，租售同权。开发共有产权茅台酒，让老百姓喝得起茅台酒，饮者有其酒。#}
            {#                </div>#}
            {#                <div class="comment_time fl">2017-01-01 00:00:00</div>#}
            {#                <a href="javascript:;" class="comment_up fr" data-comment-id="4">赞</a>#}
            {#                <a href="javascript:;" class="comment_reply fr">回复</a>#}
            {#                <from class="reply_form fl">#}
            {#                    <textarea class="reply_input"></textarea>#}
            {#                    <input type="submit" name="" value="回复" data-news-id="1" data-comment-id="4" class="reply_sub fr">#}
            {#                    <input type="reset" name="" value="取消" class="reply_cancel fr">#}
            {#                </from>#}
            {#            </div>#}
        </div>
    </div>
{% endblock %}
{% block rank_contentBlock %}
    {% if data.news.user %}
        <div class="author_card">
            <a href="#" class="author_pic"><img src="{% if data.news.user.avatar_url %}
            {{ data.news.user.avatar_url }}
            {% else %}
            ../../static/news/images/user_pic.png
            {% endif %}" alt="author_pic"></a>
            <a href="#" class="author_name">{{ data.news.user.nick_name }}</a>
            <div class="author_resume">签名：{{ data.news.user.signature }}</div>
            <div class="writings"><span>总篇数</span><b>{{ data.news_count }}</b></div>
            <div class="follows"><span>粉丝</span><b>{{ data.followers_count }}</b></div>
            {% if data.user.id != data.news.user_id %}
                <a href="javascript:;" class="focus fr">关注</a>
                <a href="javascript:;" class="focused fr" style="display: none;"><span class="out">已关注</span><span class="over">取消关注</span></a>
            {% endif %}
        </div>
    {% endif %}
    {#    <div class="author_card">#}
    {#        <a href="#" class="author_pic"><img src="../../static/news/images/user_pic.png" alt="author_pic"></a>#}
    {#        <a href="#" class="author_name">张大山</a>#}
    {#        <div class="author_resume">张大山的简介,张大山</div>#}
    {#        <div class="writings"><span>总篇数</span><b>23</b></div>#}
    {#        <div class="follows"><span>粉丝</span><b>36</b></div>#}
    {#        <a href="javascript:;" class="focus fr">关注</a>#}
    {#        <a href="javascript:;" class="focused fr"><span class="out">已关注</span><span class="over">取消关注</span></a>#}
    {#    </div>#}
{% endblock %}
